//
//  PackageCollectCell.m
//  BaseProject
//
//  Created by 王洋 on 2020/7/28.
//  Copyright © 2020 王洋. All rights reserved.
//

#import "PackageCollectCell.h"

@implementation PackageCollectCell

- (void)awakeFromNib {
    [super awakeFromNib];
    
    
    self.priceLab.userInteractionEnabled = YES;
      [self.priceLab addGestureTapEventHandle:^(id  _Nonnull sender, UITapGestureRecognizer * _Nonnull gestureRecognizer) {
          if (self.PackageCollectLoginBlock) {
              self.PackageCollectLoginBlock();
          }
      }];
}

- (void)layoutSubviews {
    [super layoutSubviews];
    
    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.01 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
        [self.mainImageView pp_clipCorners:UIRectCornerAllCorners radius:6];
    });
}

- (void)fillCellWithModel:(CommonPackageModel *)model {

    [self.mainImageView sd_setImageWithURL:[NSURL URLWithString:model.hengUrl] placeholderImage:[UIImage imageNamed:@"placeholder"]];
    self.mainTitleLab.text = model.goodsName;
    
//    if ([TTUserModel sharedObject].token.length > 0) {

        self.priceLab.text = [NSString stringWithFormat:@"¥%@",[Utilities changeDoubleToString:model.goodsActivePrice]];
//    } else {
//        self.priceLab.text = @"登录后查看补贴价";
//    }
}

@end
